const _ = require('lodash')
const fp = require('lodash/fp')

// loadsh 中函数组合方法 flow()从左到右 flowRight() 从右到左
// const reverse = array => array.reverse()
// const first = array => array[0]
// const toUpper = s => s.toUpperCase()

// const f = _.flow(_.reverse, _.first, _.toUpper)
// const f = _.flow(_.flow(_.reverse, _.first), _.toUpper)
// const f = _.flow(_.reverse, _.flow(_.first, _.toUpper))

// console.log(f(['one', 'two', 'three']))



const cars = [
  {
    name: 'Ferrari FF first',
    horsepower: 660,
    dollar_value: 700000,
    in_stock: true
  },
  {
    name: 'Spyker C12 Zagato',
    horsepower: 650,
    dollar_value: 648000,
    in_stock: false
  },
  {
    name: 'Jaquar SKR_S',
    horsepower: 550,
    dollar_value: 132000,
    in_stock: false
  },
  {
    name: 'Audi R8',
    horsepower: 525,
    dollar_value: 114200,
    in_stock: false
  },
  {
    name: 'Aston Martin One-77',
    horsepower: 750,
    dollar_value: 185000,
    in_stock: true
  },
  {
    name: 'Pagani Huayra last',
    horsepower: 700,
    dollar_value: 130000,
    in_stock: false
  }
]